import React from 'react';
import View from './views';
import Button from '../components/button';
import { ConfigProvider } from '../components';
import './app.scss';

export default function App() {
  const [locale, setLocale] = React.useState('zh-CN');

  return (
    <ConfigProvider locale={locale}>
      <div id="app">
        <div className="actions">
          <h2 style={{marginRight: '30px'}}>{ locale === 'zh-CN' ? '语言切换' : 'language switch'} :</h2>

          <Button onClick={() => {setLocale('zh-CN');}}>中文</Button>
          <Button onClick={(e) => {setLocale('en-US');}}>英文</Button>
        </div>
        <View/>
      </div>
    </ConfigProvider>
  );
}
